﻿<UserControl x:Class="TagFlo.Views.ImageViewer"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    >
    <UserControl.Resources>

        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="..\Resources\ResourceDictionary.xaml"/>
                <ResourceDictionary Source="..\Resources\ControlStyle.xaml"/>
                <ResourceDictionary Source="..\Themes\current.theme.xaml"/>
            </ResourceDictionary.MergedDictionaries>

            <Style x:Key="ImageNavButton" TargetType="{x:Type Button}">
                <Setter Property="OverridesDefaultStyle" Value="true" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Border x:Name="Border" CornerRadius="1" Opacity=".5" BorderBrush="{StaticResource BorderBrush}" BorderThickness="2" Background="{StaticResource PanelBackgroundBrush}">
                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Content="{Binding Path=Content, RelativeSource={RelativeSource TemplatedParent}}"/>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter TargetName="Border" Property="Opacity" Value="1"/>
                               </Trigger>
                                <Trigger Property="IsEnabled" Value="false">
                                    <Setter TargetName="Border" Property="Visibility" Value="Hidden"/>

                                </Trigger>
                                <Trigger Property="IsPressed" Value="true">
                                    <Setter TargetName="Border" Property="Background">
                                        <Setter.Value>
                                            <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                                                <LinearGradientBrush.GradientStops>
                                                    <GradientStop Offset="0" Color="#EEEEEE"/>
                                                    <GradientStop Offset="1" Color="#DFDFDF"/>
                                                </LinearGradientBrush.GradientStops>
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

        </ResourceDictionary>

    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="25"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="25"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="30"/>
        </Grid.RowDefinitions>
    <Border x:Name="ImageViewerBorder" Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="0" Grid.RowSpan="2" PreviewKeyDown="ImageViewer_PreviewKeyDown"   SnapsToDevicePixels="True" Background="DarkGray" MouseLeftButtonUp="ImageViewer_MouseLeftButtonUp">
        <Border Margin="10" >
            <Border.BitmapEffect>
                <DropShadowBitmapEffect Opacity="0.5" />
            </Border.BitmapEffect>
            <Image x:Name="LargeImage" HorizontalAlignment="Center"  VerticalAlignment="Center" />
        </Border>
    </Border>
        <Button x:Name="PreviousImageButton" Style="{StaticResource ImageNavButton}" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Center" Width="20" Height="20"  VerticalAlignment="Center" Click="PreviousImageButton_Click">
            <Button.Content>
            <Path Stroke="{StaticResource ForegroundBrush}" Fill="{StaticResource BackgroundBrush}" StrokeThickness="1px" StrokeLineJoin="Miter" StrokeEndLineCap="Flat" Data="M 7.9737624 1.1252474 L 8.0638615 9 L 3.8742575 5 L 7.9737624 1.1252474 z"/>
          </Button.Content>
        </Button>
        <Button x:Name="NextImageButton" Style="{StaticResource ImageNavButton}"  Grid.Column="2" Grid.Row="0" HorizontalAlignment="Center" Width="20" Height="20"  VerticalAlignment="Center" Click="NextImageButton_Click">
            <Button.Content>
            <Path  Stroke="{StaticResource ForegroundBrush}" Fill="{StaticResource BackgroundBrush}" StrokeThickness="1px" StrokeLineJoin="Miter" StrokeEndLineCap="Flat" Data="M 3.9643566 1.1252474 L 3.8742575 9 L 8.0638615 5 L 3.9643566 1.1252474 z"/>
        </Button.Content>
            </Button>
        <Button x:Name="AddImageButton" Style="{StaticResource ImageNavButton}"  Grid.Column="1" Grid.Row="1" HorizontalAlignment="Center" Height="25"  VerticalAlignment="Center" Click="AddImageButton_Click">
            <Button.Content>
                <DockPanel>
                    <TextBlock Margin="2">Add to Photo Set </TextBlock>
                    <Path Margin="2" VerticalAlignment="Center" Stroke="{StaticResource ForegroundBrush}" Fill="{StaticResource BackgroundBrush}"  StrokeThickness="1px" StrokeLineJoin="Miter" StrokeEndLineCap="Flat" Data="M 1.1252474 2.8777228 L 9 2.7876237 L 5 6.9772277 L 1.1252474 2.8777228 z"/>
                    </DockPanel>
            </Button.Content>
        </Button>

    </Grid>
</UserControl>
